Skip to content

Swapping bundle publish to OCI#151

Merged
chrisghill merged 13 commits into
mainfrom
chris/feature/publish-to-oci-registry
Jun 13, 2025
Merged

Swapping bundle publish to OCI#151
chrisghill merged 13 commits into
mainfrom
chris/feature/publish-to-oci-registry

Conversation

@chrisghill
Copy link
Copy Markdown
Member

@chrisghill chrisghill commented Jun 5, 2025

Changing the mass bundle publish to push to an OCI registry.

@chrisghill chrisghill requested a review from coryodaniel as a code owner June 5, 2025 20:58
@chrisghill chrisghill requested a review from a team June 5, 2025 20:58
@chrisghill chrisghill requested review from Copilot June 13, 2025 18:20
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR replaces the legacy S3-based bundle publisher and packager with an OCI registry workflow using ORAS, updates the CLI to use the Massdriver SDK and ORAS targets, and adds test data and tests for the new PackageBundle behavior.

  • Introduces PublishBundle and PackageBundle methods under pkg/commands/publish leveraging ORAS and go-gitignore
  • Updates cmd/bundle.go and pkg/commands/publish/main.go to wire in the new SDK client and ORAS-based flow
  • Adds testdata/simple fixtures and a package_test.go to verify manifest layers and media types

Reviewed Changes

Copilot reviewed 22 out of 22 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
pkg/commands/publish/publisher.go & packager.go Removed legacy S3-based publisher and packager code
pkg/commands/publish/publish.go Added ORAS-based Publisher.PublishBundle implementation
pkg/commands/publish/package.go Added Publisher.PackageBundle using filepath.Walk & go-gitignore
pkg/commands/publish/mime.go Added MIME type mapping; defaults to "nil"
pkg/commands/publish/package_test.go New tests for PackageBundle verifying layer annotations & types
cmd/bundle.go Renamed CLI flag to bundle-directory; integrated Massdriver SDK
pkg/commands/publish/main.go Updated Run to use SDK client, memory store, and ORAS calls
pkg/commands/publish/testdata/simple/* Sample bundle files for tests
go.mod Upgraded Go version and bumped dependencies for ORAS usage
.github/workflows/lint.yaml Bumped Go version and updated golangci-lint action
Comments suppressed due to low confidence (2)

pkg/commands/publish/main.go:319

  • [nitpick] The tag is hard-coded to "latest" with no CLI override; consider adding a flag or parameter so users can specify a custom OCI tag.
    tag := "latest"

.github/workflows/lint.yaml:25

  • [nitpick] The version here refers to the golangci-lint binary, not the action release; verify the intended lint version and use a matching semantic tag (e.g., v1.x or latest).
          version: v2.1

Comment thread pkg/commands/publish/mime.go Outdated
if mimeType, exists := mimeTypesFromExt[ext]; exists {
return mimeType
}
return "nil"
Copy link

Copilot AI Jun 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Returning "nil" as the default MIME type yields an invalid media type; consider using a sensible fallback such as "application/octet-stream" or "text/plain" instead.

Suggested change
return "nil"
return "application/octet-stream"

Copilot uses AI. Check for mistakes.
Comment on lines +65 to +66
if mimeType, exists := mimeTypesFromExt[ext]; exists {
return mimeType
Copy link

Copilot AI Jun 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Special multi-part extensions like ".tar.gz" won't match here because filepath.Ext returns only ".gz"; you may need to detect and handle compound extensions before the standard lookup.

Suggested change
if mimeType, exists := mimeTypesFromExt[ext]; exists {
return mimeType
// Split the extension into parts for compound extensions
parts := strings.Split(ext, ".")
for i := len(parts) - 1; i >= 0; i-- {
compoundExt := "." + strings.Join(parts[i:], ".")
if mimeType, exists := mimeTypesFromExt[compoundExt]; exists {
return mimeType
}

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@chrisghill chrisghill merged commit 1a94b1a into main Jun 13, 2025
2 of 4 checks passed
@chrisghill chrisghill deleted the chris/feature/publish-to-oci-registry branch June 13, 2025 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants